home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / mach / ds3100.md / ultrixSignal.h < prev   
C/C++ Source or Header  |  1989-10-26  |  9KB  |  218 lines

  1. /*    @(#)signal.h    4.1.1.4    (ULTRIX)    11/9/88    */
  2.  
  3. /************************************************************************
  4.  *                                    *
  5.  *            Copyright (c) 1987 by                *
  6.  *        Digital Equipment Corporation, Maynard, MA        *
  7.  *            All rights reserved.                *
  8.  *                                    *
  9.  *   This software is furnished under a license and may be used and    *
  10.  *   copied  only  in accordance with the terms of such license and    *
  11.  *   with the  inclusion  of  the  above  copyright  notice.   This    *
  12.  *   software  or  any  other copies thereof may not be provided or    *
  13.  *   otherwise made available to any other person.  No title to and    *
  14.  *   ownership of the software is hereby transferred.            *
  15.  *                                    *
  16.  *   This software is  derived  from  software  received  from  the    *
  17.  *   University    of   California,   Berkeley,   and   from   Bell    *
  18.  *   Laboratories.  Use, duplication, or disclosure is  subject  to    *
  19.  *   restrictions  under  license  agreements  with  University  of    *
  20.  *   California and with AT&T.                        *
  21.  *                                    *
  22.  *   The information in this software is subject to change  without    *
  23.  *   notice  and should not be construed as a commitment by Digital    *
  24.  *   Equipment Corporation.                        *
  25.  *                                    *
  26.  *   Digital assumes no responsibility for the use  or  reliability    *
  27.  *   of its software on equipment which is not supplied by Digital.    *
  28.  *                                    *
  29.  ************************************************************************/
  30. /************************************************************************
  31.  *            Modification History                *
  32.  *                                    *
  33.  *    Mark Parenti 2/06/88                        *
  34.  *        Change SA_CLDSTOP to SA_NOCLDSTOP per POSIX change    *
  35.  *    Fred Glover 1/12/88                        *
  36.  *        Add SIGLOST - server crash Sys-V lock notification      *
  37.  *                                    *
  38.  *    Larry Cohen 10/1/85                        *
  39.  *        Add SIGWINCH - window change signal            *
  40.  *                                    *
  41.  *    Greg Depp  25 Jun 85                        *
  42.  *    Moved SIGUSR1 and SIGUSR2 to 30 and 31 to conform with Berkeley *
  43.  *                                    *
  44.  *    David L Ballenger, 28-Mar-1985                    *
  45.  * 0001 Add definitions for System V compatibility            *
  46.  *                                    *
  47.  ************************************************************************/
  48.  
  49. #ifndef    NSIG
  50. #define NSIG    32
  51.  
  52. #define    SIGHUP     1    /* hangup */
  53. #define    SIGINT     2    /* interrupt */
  54. #define    SIGQUIT    3    /* quit */
  55. #define    SIGILL     4    /* illegal instruction (not reset when caught) */
  56. #define        ILL_RESAD_FAULT    0x0    /* reserved addressing fault */
  57. #define        ILL_PRIVIN_FAULT    0x1    /* privileged instruction fault */
  58. #define        ILL_RESOP_FAULT    0x2    /* reserved operand fault */
  59. /* CHME, CHMS, CHMU are not yet given back to users reasonably */
  60. #define    SIGTRAP    5    /* trace trap (not reset when caught) */
  61. #define    SIGIOT     6    /* IOT instruction */
  62. #define    SIGEMT     7    /* EMT instruction */
  63. #define    SIGFPE     8    /* floating point exception */
  64. #define        FPE_INTOVF_TRAP    0x1    /* integer overflow */
  65. #define        FPE_INTDIV_TRAP    0x2    /* integer divide by zero */
  66. #define        FPE_FLTOVF_TRAP    0x3    /* floating overflow */
  67. #define        FPE_FLTDIV_TRAP    0x4    /* floating/decimal divide by zero */
  68. #define        FPE_FLTUND_TRAP    0x5    /* floating underflow */
  69. #define        FPE_DECOVF_TRAP    0x6    /* decimal overflow */
  70. #define        FPE_SUBRNG_TRAP    0x7    /* subscript out of range */
  71. #define        FPE_FLTOVF_FAULT    0x8    /* floating overflow fault */
  72. #define        FPE_FLTDIV_FAULT    0x9    /* divide by zero floating fault */
  73. #define        FPE_FLTUND_FAULT    0xa    /* floating underflow fault */
  74. #define    SIGKILL    9    /* kill (cannot be caught or ignored) */
  75. #define    SIGBUS    10    /* bus error */
  76. #define    SIGSEGV   11    /* segmentation violation */
  77. #define    SIGSYS    12    /* bad argument to system call */
  78. #define    SIGPIPE   13    /* write on a pipe with no one to read it */
  79. #define    SIGALRM   14    /* alarm clock */
  80. #define    SIGTERM   15    /* software termination signal from kill */
  81. #define    SIGURG    16    /* urgent condition on IO channel */
  82. #define    SIGSTOP   17    /* sendable stop signal not from tty */
  83. #define    SIGTSTP   18    /* stop signal from tty */
  84. #define    SIGCONT   19    /* continue a stopped process */
  85. #define    SIGCHLD   20    /* to parent on child stop or exit */
  86. #define    SIGTTIN   21    /* to readers pgrp upon background tty read */
  87. #define    SIGTTOU   22    /* like TTIN for output if (tp->t_local<OSTOP) */
  88. #define    SIGIO     23    /* input/output possible signal */
  89. #define    SIGXCPU   24    /* exceeded CPU time limit */
  90. #define    SIGXFSZ   25    /* exceeded file size limit */
  91. #define    SIGVTALRM 26    /* virtual time alarm */
  92. #define    SIGPROF   27    /* profiling time alarm */
  93. #define SIGWINCH  28    /* window size changes */
  94. #define SIGLOST      29    /* Sys-V rec lock: notify user upon server crash */
  95. #define SIGUSR1   30    /* User signal 1 (from SysV) */
  96. #define SIGUSR2   31    /* User signal 2 (from SysV) */
  97.  
  98. /* Add System V signal definitions (DLB001) */
  99. #define SIGCLD    SIGCHLD    /* System V name for SIGCHLD    */
  100. #define SIGABRT    SIGIOT    /* Added from BRL package for /usr/group. Signal
  101.              * returned by abort(3C).  Map onto SIGIOT.
  102.              */
  103. /*
  104.  * Codes for the mips break instruction.
  105.  */
  106. #define    BRK_USERBP    0    /* user bp (used by debuggers) */
  107. #define    BRK_KERNELBP    1    /* kernel bp (used by prom) */
  108. #define    BRK_ABORT    2    /* no longer used */
  109. #define    BRK_BD_TAKEN    3    /* for taken bd emulation */
  110. #define    BRK_BD_NOTTAKEN    4    /* for not taken bd emulation */
  111. #define    BRK_SSTEPBP    5    /* user bp (used by debuggers) */
  112. #define    BRK_OVERFLOW    6    /* overflow check */
  113. #define    BRK_DIVZERO    7    /* divide by zero check */
  114. #define    BRK_RANGE    8    /* range error check */
  115. /* reserve 9 for ada stuff per himel */
  116.  
  117. #if defined(vax) || (defined(mips) && defined(LANGUAGE_C))
  118. #ifndef    SYSTEM_FIVE
  119.  
  120. #define    sigset_t int    /* type used for sigsetops() functions    */
  121. /*
  122.  * Signal vector "template" used in sigvec call.
  123.  */
  124. struct    sigvec {
  125.     void     (*sv_handler)();    /* signal handler */
  126.     sigset_t sv_mask;        /* signal mask to apply */
  127.     int    sv_flags;        /* see signal options below */
  128. };
  129.  
  130. /*
  131.  * The following structure must be exactly the same as the above structure
  132.  * with the names changed for POSIX compliance.
  133.  */
  134. struct    sigaction {
  135.     void     (*sa_handler)();    /* signal handler */
  136.     sigset_t sa_mask;        /* signal mask to apply */
  137.     int     sa_flags;        /* see signal options below */
  138. };
  139. #define SV_ONSTACK      0x0001  /* take signal on signal stack */
  140. #define SV_INTERRUPT    0x0002  /* do not restart system on signal return */
  141. #define    SA_NOCLDSTOP    0x0004    /* Don't generate SIGCLD when children stop */
  142. #define    SV_OLDSIG    0x1000    /* Emulate old signal() for POSIX */
  143. #define sv_onstack sv_flags     /* isn't compatibility wonderful! */
  144.  
  145. /* Defines for sigprocmask() call. POSIX.
  146.  */
  147. #define    SIG_BLOCK    1        /* Add these signals to block mask    */
  148. #define    SIG_UNBLOCK    2        /* Remove these signals from block mask */
  149. #define    SIG_SETMASK    3        /* Set block mask to this mask        */
  150.  
  151. /*
  152.  * Structure used in sigstack call.
  153.  */
  154. struct    sigstack {
  155.     char    *ss_sp;            /* signal stack pointer */
  156.     int    ss_onstack;        /* current status */
  157. };
  158.  
  159. /*
  160.  * Information pushed on stack when a signal is delivered.
  161.  * This is used by the kernel to restore state following
  162.  * execution of the signal handler.  It is also made available
  163.  * to the handler to allow it to properly restore state if
  164.  * a non-standard exit is performed.
  165.  *
  166.  * WARNING: THE sigcontext MUST BE KEPT CONSISTENT WITH /usr/include/setjmp.h
  167.  * AND THE LIBC ROUTINES setjmp() AND longjmp()
  168.  */
  169. struct    sigcontext {
  170.     int    sc_onstack;        /* sigstack state to restore */
  171.     int    sc_mask;        /* signal mask to restore */
  172.     int    sc_pc;            /* pc at time of signal */
  173.     /*
  174.      * General purpose registers
  175.      */
  176.     int    sc_regs[32];    /* processor regs 0 to 31 */
  177.     int    sc_mdlo;    /* mul/div low */
  178.     int    sc_mdhi;    /* mul/div high */
  179.     /*
  180.      * Floating point coprocessor state
  181.      */
  182.     int    sc_ownedfp;    /* fp has been used */
  183.     int    sc_fpregs[32];    /* fp regs 0 to 31 */
  184.     int    sc_fpc_csr;    /* floating point control and status reg */
  185.     int    sc_fpc_eir;    /* floating point exception instruction reg */
  186.     /*
  187.      * END OF REGION THAT MUST AGREE WITH setjmp.h
  188.      * END OF jmp_buf REGION
  189.      */
  190.     /*
  191.      * System coprocessor registers at time of signal
  192.      */
  193.     int    sc_cause;    /* cp0 cause register */
  194.     int    sc_badvaddr;    /* cp0 bad virtual address */
  195.     int    sc_badpaddr;    /* cpu bd bad physical address */
  196. };
  197. #endif    SYSTEM_FIVE
  198.  
  199. #define    BADSIG        ((void (*)())(-1))
  200. #define    SIG_ERR        ((void (*)())(-1))
  201. #define    SIG_DFL        ((void (*)())( 0))
  202. #define    SIG_IGN        ((void (*)())( 1))
  203.  
  204. #ifdef KERNEL
  205. #define    SIG_CATCH    ((void (*)())( 2))
  206. #define    SIG_HOLD    ((void (*)())( 3))
  207. #else KERNEL
  208. extern void        (*signal())();
  209. #endif KERNEL
  210. #endif defined(vax) || (defined(mips) && defined(LANGUAGE_C))
  211.  
  212. /*
  213.  * Macro for converting signal number to a mask suitable for
  214.  * sigblock().
  215.  */
  216. #define sigmask(m)    (1 << ((m)-1))
  217. #endif NSIG
  218.